import { WereWolfAttackVoteComponent } from "@/werewolf/components/attckVote";
import { WereWolfNextTool } from "@/werewolf/components/nextTool";
import { WereWolfVotePhase } from "@/werewolf/phases/vote";
import { WereWolfPhaseView } from "@/werewolf/phaseView";
import { world } from "@minecraft/server";
import { ScriptRunner } from "@sapi-game/Runner/scriptRunner";

export class VoteCampView extends WereWolfPhaseView<WereWolfVotePhase> {
    override async runPhaseView(r: ScriptRunner): Promise<void> {
        this.players.title("§e投票开始", "§b攻击玩家给予对方你的票");
        this.players.playSound("note.pling");
        world.gameRules.pvp = true;
        this.state.addComponent(WereWolfAttackVoteComponent);
        this.state.getComponent(WereWolfNextTool).giveNextItemToReferee();
    }
}
